package com.ecommerceWeb.common;

import java.util.*;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean;
public abstract class MessageFactory {
	ResourceBundle bundle;
	Locale locale;
	private String myMessage;
	
	public MessageFactory() { 
		locale = FacesContext.getCurrentInstance().getViewRoot().getLocale();
    	bundle = ResourceBundle.getBundle("com.ecommerceWeb.common.messages", locale);
	}
	
	public String getMessage(String key) {
		return bundle.getString(key);
	}

	public void setMyMessage(String myMessage) {
		this.myMessage = myMessage;
	}

	public String getMyMessage() {
		return myMessage;
	}
	
	public static String status_admin_faillure="failure";
	public static String status_admin_created="created";
	public static String status_confirm="confirm";
	public static String status_client_failure="failure";
	public static String status_connection_failure="fail_connection";
	public static String status_connection_client="success_client";
	public static String status_connection_admin="success_admin";
	public static String status_composant_failure="failure";
	public static String status_composant_created="created";
	public static String status_categorie_failure="failure";
	public static String status_categorie_created="created";
	
	
	
}